package com.itheima.project.face.impl;

import com.itheima.project.adapter.CashPayAdapter;
import com.itheima.project.exception.ProjectException;
import com.itheima.project.face.CashPayFace;
import com.itheima.project.vo.trade.TradingVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ClassName CashPayFaceImpl.java
 * @Description 现金支付方式：商户收钱直接操作
 */
@Slf4j
@Component
public class CashPayFaceImpl implements CashPayFace {

    @Autowired
    CashPayAdapter cashPayAdapter;

    @Override
    @Transactional
    public TradingVo createCashTrading(TradingVo tradingVo) throws ProjectException {
        return cashPayAdapter.createCashTrading(tradingVo);
    }

    @Override
    @Transactional
    public TradingVo refundCashTrading(TradingVo tradingVo) {
        return cashPayAdapter.refundCashTrading(tradingVo);
    }

}
